package ldh.im.base;

import io.netty.channel.Channel;
import ldh.im.base.ImSession;

import java.util.HashMap;
import java.util.Map;

public class DefaultImSession implements ImSession {

    private Channel channel;

    public DefaultImSession(Channel channel) {
        this.channel = channel;
    }

    private Map<String, Object> dataMap = new HashMap();

    @Override
    public void put(String key, Object value) {
        dataMap.put(key, value);
    }

    @Override
    public void remove(String key) {
        dataMap.remove(key);
    }

    @Override
    public Object get(String key) {
        return dataMap.get(key);
    }

    @Override
    public void clean() {
        dataMap.clear();
    }

    @Override
    public Channel getChannel() {
        return channel;
    }
}
